﻿<?php

class Crud extends CI_Model {
	var $data = array();
	var $controller;
	var $table_name;
	function __construct()
    {
        // Call the Model constructor
        parent::__construct();
 
		$this->load->library('errors');
		$this->load->library('validation');
		$this->load->database();
	}
		
	function get_all($table_name)
	{
		$query = $this->db->get($table_name);
		return $query->result();
		
	}

	
	/*DELETE FUNCTION: given table name and id number, deletes an entry*/
	function delete($controller, $idno, $state='no', $test='no')
	{
		
		
	}

	function insert($controller='', $id=0, $test='no')
	{
		
	}
}